package drexel.cs544.nap;

public class NAP {

    public enum State {

        Closed, Listen, Config, Data
    }

    public static enum Message {

        MSG_CLIENT_CONNECTION_REQUEST(1, 17),
        MSG_CLIENT_CONNECTION_ERROR(2),
        MSG_CLIENT_CONNECTION_ACCEPT(3, 13),
        MSG_SERVER_REQUEST_TO_ADD_CLIENT(5, 17),
        MSG_CLIENT_ADD_ACK(6, 5),
        MSG_CLIENT_ADD_NACK(7),
        MSG_DISCONNECT(8),
        MSG_SERVER_CONFIGURATION_REQUEST(20),
        MSG_CLIENT_CONFIGURATION_ACK(21, 5),
        MSG_CLIENT_CONFIGURATION_NACK(22),
        MSG_SERVER_CONFIGURATION_COMPLETE(30, 5),
        MSG_DATA_MESSAGE(50, 1000),
        MSG_DATA_ACK(51),
        MSG_DATA_NACK(52),
        MSG_DATA_WINDOW_ADJUST(60);
        private final byte value;
        private final int length;

        public byte Value() {
            return this.value;
        }

        public int Length() {
            return this.length;
        }

        Message(int value, int length) {
            this.value = (byte) value;
            this.length = length;
        }

        Message(int value) {
            this.value = (byte) value;
            this.length = -1;
        }
    }
}
